package com.gjxx.common.tcp;


import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 位置信息汇报消息
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class LocationInfoUploadMsg extends PackageData {
	// 告警信息
	// byte[0-3]
	private String warningFlagField;
	// byte[4-7] 状态(DWORD(32))
	private String statusField;
	// byte[8-11] 纬度(DWORD(32))
	private long latitude;
	// byte[12-15] 经度(DWORD(32))
	private long longitude;
	// byte[16-17] 高程(WORD(16)) 海拔高度，单位为米（ m）
	// TODO ==>int?海拔
	private int elevation;
	// byte[18-19] 速度(WORD) 1/10km/h
	// TODO ==>long?速度
	private long speed;
	// byte[20-21] 方向(WORD) 0-359，正北为 0，顺时针
	private int direction;
	// byte[22-x] 时间(BCD[6]) yyMMddHHmmss
	// GMT+8 时间，本标准中之后涉及的时间均采用此时区
	private String trajectoryTime;
	// byte[28-29] 附加信息ID
	private String addInfoId;
	// byte[30-x] 附加信息
	private String addInfo;


	public LocationInfoUploadMsg() {
	}

	public LocationInfoUploadMsg(PackageData packageData) {
		this();
		this.channel = packageData.getChannel();
		this.checkSum = packageData.getCheckSum();
		this.calculatedCheckSum = packageData.getCalculatedCheckSum();
		this.msgBodyBytes = packageData.getMsgBodyBytes();
		this.msgHeader = packageData.getMsgHeader();
	}
}
